<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 14-8-1
 * Time: 下午1:41
 */

class pa_report {

    public function execute() {

        if (isset($_REQUEST['operFlg']) && quanli_is_int($_REQUEST['operFlg'])) {

            $this->reportForUserID( $_REQUEST['operFlg'] );

        } else {

            backendError();

        }

    }

    private function reportForUserID( $operFlg ) {

        global $G_SHOP;

        $url = '';

        $user_obj = new entity('user_master');
        $user_obj->userID = $G_SHOP->currentUserID;
        $G_SHOP->DBCA->fetch($user_obj);

        switch($operFlg) {

            case 1: //营业额统计年报表（按月）
                //$url = 'http://rpt.fistforward.com:8081/mcakerpt/frameset?__report=P_fac_daily_goods.rptdesign&uuid=' . $user_obj->uuid;
                $url = 'http://121.43.104.7:8080/WebReport/ReportServer?reportlet=standard_report%2FBusinessReport_YEAR.cpt&__bypagesize__=false';
                break;

            case 2: //营业额统计月报表（按日）
                //$url = 'http://rpt.fistforward.com:8081/mcakerpt/frameset?__report=P_fac_daily_goods_i.rptdesign&uuid=' . $user_obj->uuid;
                $url = 'http://121.43.104.7:8080/WebReport/ReportServer?reportlet=standard_report%2FBusinessReport_DAY.cpt&__bypagesize__=false';
                break;

            case 3: //商品销售数量年报
                //$url = 'http://rpt.fistforward.com:8081/mcakerpt/frameset?__report=P_lgt_daily_kpi.rptdesign&uuid=' . $user_obj->uuid;
                $url = 'http://121.43.104.7:8080/WebReport/ReportServer?reportlet=standard_report%2FSalesYears.cpt&__bypagesize__=false';
                break;

            case 4: //商品销售数量月报
                //$url = 'http://rpt.fistforward.com:8081/mcakerpt/frameset?__report=P_FN_invoice.rptdesign&uuid=' . $user_obj->uuid;
                $url = 'http://121.43.104.7:8080/WebReport/ReportServer?reportlet=standard_report%2FSalesDays.cpt&__bypagesize__=false';
                break;

            case 5: //销售月报（按配送日期）
                //$url = 'http://rpt.fistforward.com:8081/mcakerpt/output?__report=P_mt_bill_return_head.rptdesign&&uuid=' . $user_obj->uuid;
                //$url = 'http://rpt.fistforward.com/output?__report=report/P_mt_bill_return_head.rptdesign&&uuid=' . $user_obj->uuid;
                $url = 'http://121.43.104.7:8080/WebReport/ReportServer?reportlet=standard_report%2FSalesByDay_BySendDate.cpt&__bypagesize__=false';

                break;

            case 6://销售月报（按下单日期）
                //$url = 'http://rpt.fistforward.com:8081/mcakerpt/frameset?__report=P_fn_distribution_checking.rptdesign&uuid=' . $user_obj->uuid;
                $url = 'http://121.43.104.7:8080/WebReport/ReportServer?reportlet=standard_report%2FSalesByDay.cpt&__bypagesize__=false';
                break;

            case 7://销售台帐报表
                //$url = 'http://rpt.fistforward.com:8081/mcakerpt/frameset?__report=P_MT_salesledger.rptdesign&uuid=' . $user_obj->uuid;
                $url = 'http://rpt.fistforward.com/frameset?__report=report/P_MT_salesledger.rptdesign&uuid=' . $user_obj->uuid;
                break;
            case 8://现金卡查询
                //$url = 'http://rpt.fistforward.com:8081/mcakerpt/output?__report=P_SA_cardquery.rptdesign&uuid=' . $user_obj->uuid;
                $url = 'http://rpt.fistforward.com/output?__report=report/P_SA_cardquery.rptdesign&uuid=' . $user_obj->uuid;
                break;
            case 9://订单支付审核表
                //$url = 'http://rpt.fistforward.com:8081/mcakerpt/frameset?__report=P_fn_bill_paydetail.rptdesign&uuid=' . $user_obj->uuid;
                $url = 'http://rpt.fistforward.com/frameset?__report=report/P_fn_bill_paydetail.rptdesign&uuid=' . $user_obj->uuid;
                break;
            case 10://销售日报
                //$url = 'http://rpt.fistforward.com:8081/mcakerpt/frameset?__report=P_SA_daily_rpt.rptdesign&uuid=' . $user_obj->uuid;
                $url = 'http://rpt.fistforward.com/frameset?__report=report/P_SA_daily_rpt.rptdesign&uuid=' . $user_obj->uuid;
                break;
            case 11://销售周报
                //$url = 'http://rpt.fistforward.com:8081/mcakerpt/frameset?__report=P_SA_week_rptdesign&uuid=' . $user_obj->uuid;
                $url = 'http://rpt.fistforward.com/frameset?__report=report/P_SA_week_rpt.rptdesign&uuid=' . $user_obj->uuid;
                break;
            case 12://销售月报
                //$url = 'http://rpt.fistforward.com:8081/mcakerpt/frameset?__report=P_SA_month_rptdesign&uuid=' . $user_obj->uuid;
                $url = 'http://rpt.fistforward.com/frameset?__report=report/P_SA_month_rpt.rptdesign&uuid=' . $user_obj->uuid;
                break;
            case 13://条码查询
                //$url='http://rpt.fistforward.com:8081/mcakerpt/frameset?__report=P_lgtc_billgoodsno.rptdesign&uuid=' . $user_obj->uuid;
                $url = 'http://rpt.fistforward.com/frameset?__report=report/P_lgtc_billgoodsno.rptdesign&uuid=' . $user_obj->uuid;
                break;
            case 14://优惠券解绑
                //$url='http://rpt.fistforward.com:8081/mcakerpt/output?__report=P_SA_couponquery.rptdesign&uuid=' . $user_obj->uuid;
                $url = 'http://rpt.fistforward.com/frameset?__report=report/P_SA_couponquery.rptdesign&uuid=' . $user_obj->uuid;
                break;
            case 15://历史试吃查询
                //$url='http://rpt.fistforward.com:8081/mcakerpt/output?__report=P_SA_tryeatbill.rptdesign&uuid=' . $user_obj->uuid;
                $url = 'http://rpt.fistforward.com/frameset?__report=report/P_SA_tryeatbill.rptdesign&uuid=' . $user_obj->uuid;
                break;
            case 16://日配送单量统计表
                //$url='http://rpt.fistforward.com:8081/mcakerpt/frameset?__report=P_lgt_orderdaily.rptdesign&uuid=' . $user_obj->uuid;
                $url = 'http://rpt.fistforward.com/frameset?__report=report/P_lgt_orderdaily.rptdesign&uuid=' . $user_obj->uuid;
                break;
            case 17://日配送单量统计表
                //$url='http://rpt.fistforward.com:8081/mcakerpt/output?__report=P_lgt_orderbyhour.rptdesign&uuid=' . $user_obj->uuid;
                $url = 'http://rpt.fistforward.com/output?__report=report/P_lgt_orderbyhour.rptdesign&uuid=' . $user_obj->uuid;
                break;
            case 18://生产汇总报表(汇总)
                //$url='http://rpt.fistforward.com:8081/mcakerpt/frameset?__report=P_fac_daily_goods_ii.rptdesign&uuid=' . $user_obj->uuid;
                $url = 'http://rpt.fistforward.com/frameset?__report=report/P_fac_daily_goods_ii.rptdesign&uuid=' . $user_obj->uuid;
                break;
            case 19://周订单概况
                //$url='http://rpt.fistforward.com:8081/mcakerpt/output?__report=P_OP_weekly_dim_i.rptdesign&uuid=' . $user_obj->uuid;
                $url = 'http://rpt.fistforward.com/output?__report=report/P_OP_weekly_dim_i.rptdesign&uuid=' . $user_obj->uuid;
                break;
            case 20://周订单概况(BD)
                //$url='http://rpt.fistforward.com:8081/mcakerpt/output?__report=P_OP_weekly_dim_ii.rptdesign&uuid=' . $user_obj->uuid;
                $url = 'http://rpt.fistforward.com/output?__report=report/P_OP_weekly_dim_ii.rptdesign&uuid=' . $user_obj->uuid;
                break;
            case 21://未结算订单明细
                //$url='http://rpt.fistforward.com:8081/mcakerpt/frameset?__report=P_lgt_UnsettleOrder.rptdesign&uuid=' . $user_obj->uuid;
                $url = 'http://rpt.fistforward.com/frameset?__report=report/P_lgt_UnsettleOrder.rptdesign&uuid=' . $user_obj->uuid;
                break;

            case 22://配送统计报表（汇总）
                //$url='http://rpt.fistforward.com:8081/mcakerpt/frameset?__report=P_lgt_deliver_bill.rptdesign&uuid=' . $user_obj->uuid;
                //$url = 'http://rpt.fistforward.com/frameset?__report=report/P_lgt_deliver_bill.rptdesign&uuid=' . $user_obj->uuid;
                $url = 'http://report.fistforward.com:8075/WebReport/ReportServer?reportlet=MCAKE%2FDelivery%2FDeliveryReport.cpt&op=view&uuid=' . $user_obj->uuid;
                break;

            case 23://大客户订单明细
                $url = 'http://rpt.fistforward.com/frameset?__report=report/P_SA_big_account.rptdesign&uuid=' . $user_obj->uuid;
                break;

            case 24://1元饼干订购活动报表
                $url = 'http://rpt.fistforward.com/frameset?__report=report/P_lgt_delivername_promotion.rptdesign&uuid=' . $user_obj->uuid;
                break;

            case 25://漏操作统计报表
                $url = 'http://rpt.fistforward.com/frameset?__report=report/P_lgt_Operation_Forget.rptdesign&uuid=' . $user_obj->uuid;
                break;

            case 26://圣诞节姜饼配送报表
                $url = 'http://rpt.fistforward.com/frameset?__report=report/P_lgt_delivername_jiangbing.rptdesign&uuid=' . $user_obj->uuid;
                break;
            case 27://当天下单蛋糕统计-2
                $url = 'http://report.fistforward.com:8075/WebReport/ReportServer?reportlet=MCAKE/Produce/CakeStatisticsDaily.cpt&op=view&uuid=' . $user_obj->uuid;
                break;
            case 28://生产汇总报表-2
                $url = 'http://report.fistforward.com:8075/WebReport/ReportServer?reportlet=MCAKE/Produce/ProductionSummaryReport.cpt&op=view&uuid=' . $user_obj->uuid;
                break;

            case 29://配送统计报表-2
                $url = 'http://report.fistforward.com:8075/WebReport/ReportServer?reportlet=MCAKE/Delivery/daily_kpi.cpt&uuid=' . $user_obj->uuid;
                break;

            case 30://配送回款统计表-2
                $url = 'http://report.fistforward.com:8075/WebReport/ReportServer?reportlet=MCAKE/Delivery/DistributionPaymentStatistics.cpt&uuid=' . $user_obj->uuid;
                break;

            case 31://顺丰发货单导出
                $url = 'http://report.fistforward.com:8075/WebReport/ReportServer?reportlet=MCAKE%2FDelivery%2FDelivery_josephine.cpt&op=view&uuid=' . $user_obj->uuid;
                break;

            case 32://杭州发货单导出
                $url = 'http://report.fistforward.com:8075/WebReport/ReportServer?reportlet=MCAKE%2FDelivery%2FDelivery_josephine_hangzhou.cpt&op=view&uuid=' . $user_obj->uuid;
                break;

            case 33://财务开票统计-约瑟芬
                $url = 'http://rpt.fistforward.com/frameset?__report=report/P_fn_invoice_josephone.rptdesign&uuid=' . $user_obj->uuid;
                break;

            case 34://生产汇总报表（统计专用）
                $url = 'http://report.fistforward.com:8075/WebReport/ReportServer?reportlet=MCAKE%2FProduce%2FProductionSummaryReport-All.cpt&op=view&uuid=' . $user_obj->uuid;
                break;

            case 35://配送统计报表（拿破仑mini）
                $url = 'http://report.fistforward.com:8075/WebReport/ReportServer?reportlet=MCAKE%2FDelivery%2Fdaily_kpi_mini.cpt&uuid=' . $user_obj->uuid;
                break;

            case 36://下午茶配送提成
                $url = 'http://report.fistforward.com:8075/WebReport/ReportServer?reportlet=MCAKE/Delivery/afternoontea_daily.cpt&op=view&uuid=' . $user_obj->uuid;
                break;

            case 37://呼叫中心报表DEMO
                $url = 'http://121.43.104.7:8080/WebReport/ReportServer?reportlet=standard_report%2Fcs_call_rate_report.cpt';
                break;

            default:
                backendError('链接未找到');
                break;
        }
        header('Location:' . $url);
    }

}